from collections.abc import Mapping

from core.rule.nodes.answer import AnswerNode
from core.rule.nodes.base import BaseNode

from core.rule.nodes.enums import NodeType

from core.rule.nodes.condition import IfElseNode
from core.rule.nodes.start import StartNode
from core.rule.nodes.end import EndNode

LATEST_VERSION = "latest"

NODE_TYPE_CLASSES_MAPPING: Mapping[NodeType, Mapping[str, type[BaseNode]]] = {
    NodeType.START: {
        LATEST_VERSION: StartNode,
        "1": StartNode,
    },
    NodeType.END: {
        LATEST_VERSION: EndNode,
        "1": EndNode,
    },
    NodeType.IF_ELSE: {
        LATEST_VERSION: IfElseNode,
        "1": IfElseNode,
    },
    NodeType.ANSWER: {
        LATEST_VERSION: AnswerNode,
        "1": AnswerNode,
    },

}
